package ndk.caro.algorithms;

import android.graphics.Point;
import ndk.caro.gameplays.myCaroGame;

public class myEvalueBoard
{   
    public int[][] Board;

    public myEvalueBoard(myAlgorithms GBoard)
    {
        Board = new int[myCaroGame.iGAME_SIZE][myCaroGame.iGAME_SIZE];
        ResetBoard();
    }

    public void ResetBoard()
    {
        for (int r = 0; r < myCaroGame.iGAME_SIZE; r++)
            for (int c = 0; c < myCaroGame.iGAME_SIZE; c++)
                Board[r][ c] = 0;
    }

    public Point GetMaxNode()
    {
        int r, c, MaxValue = 0;
        Point n = new Point();

        for (r = 1; r <= myCaroGame.iGAME_SIZE-2; r++)
            for (c = 1; c <= myCaroGame.iGAME_SIZE-2; c++)
                if (Board[r][ c] > MaxValue)
                {
                    n.x = r; n.y = c;
                    MaxValue = Board[r][ c];
                }

        return n;
    }
}